package myClient.sender;

import org.springframework.stereotype.Service;
import protobuf.Serialization.LoginRequestMsgConverter;
import protobuf.protoClass.ProtoMsg;

@Service("LoginSender")
public class LoginSender extends BaseSender {

    public void sendLoginMsg() {
        if (!isConnected()) {
            System.out.println("还没有建立连接!");
            return;
        }

        System.out.println("构造登录消息");

        //创建登陆请求信息
        ProtoMsg.Message message = LoginRequestMsgConverter.build(getSession());
        System.out.println("发送登录消息");

        super.sendMsg(message);
    }
}
